import request from '@/utils/request.js'

// 获取评论列表数据

const getCommentList = (queryInfo) =>{

    return request.get('/mp/v1_0/articles', {params:queryInfo})
}

// 开启/关闭评论

const changeCommentStatus = (id , commentStatus) =>{

    // return request.put('/mp/v1_0/comments/status', {params:{article_id:id} } , {allow_comment : !commentStatus})
    return request({
        method: 'put',
        url: '/mp/v1_0/comments/status',
        params:{
            article_id: id
        },
        data:{
            allow_comment: !commentStatus
        }
    })
}

export {
    getCommentList,
    changeCommentStatus
}